/*
 * Copyright 2011 group coding kata nantes
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

package fr.coding.kata.nantes.fizzbuzz.christophe;

/**
 * Enum for Fizz and Buzz word.
 */
public enum EnumFizzBuzzWords {
    /**
     * fizz.
     */
    FIZZ(3, "Fizz"),
    /**
     * buzz.
     */
    BUZZ(5, "Buzz");

// ------------------------------ FIELDS ------------------------------

    /**
     * the int value.
     */
    private final int theIntValue;

    /**
     * the replace word.
     */
    private final String theWord;

// --------------------------- CONSTRUCTORS ---------------------------

    /**
     * constructor.
     *
     * @param anIntValue the int value
     * @param anWord     the replace word
     */
    EnumFizzBuzzWords(final int anIntValue, final String anWord) {
        theIntValue = anIntValue;
        theWord = anWord;
    }

// --------------------- GETTER / SETTER METHODS ---------------------

    /**
     * getter.
     *
     * @return word.
     */
    public String getWord() {
        return theWord;
    }

// -------------------------- OTHER METHODS --------------------------

    /**
     * check if an number is multiple for this enum type.
     *
     * @param anIntValue an number
     * @return true if the number is an fizz number
     */
    public boolean isMultiple(final int anIntValue) {
        return anIntValue % theIntValue == 0;
    }
}
